How To Use A Variable In Regex Pattern In Javascript [fixed]

How To Use A Variable In Regex Pattern In Javascript [fixed]